package br.com.massai.model.facade;

import java.util.Map;
import java.util.logging.Logger;

public class EmailThread implements Runnable {

	private static Logger LOGGER = Logger.getLogger(EmailThread.class.getName());
	private EmailMassai email;

	public EmailThread() { }

	public EmailThread(Map<String, String> to, String from, String fromName, String subject, String message) {
		email = new EmailMassai(to, from, fromName, subject, message);
	}

	@Override
	public void run() {
		try{
			email.enviaEmailSimples();
			LOGGER.info("##### [EmailThread] Email enviado com sucesso.");

		} catch (Exception e) {
			e.printStackTrace();
			LOGGER.warning("##### [EmailThread] Erro ao enviar email.");
		}
	}
}